/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 pjoc.pub, blademainer.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

package pub.pjoc.pay.vo;

import java.io.Serializable;

/**
 * Config info.
 *
 * @author blademainer
 * @since 16-10-7 下午8:22
 */
public class ConfigInfo implements Serializable {
  private Long configId;
  private String configGroup;
  private String configName;
  private String configValue;

  public Long getConfigId() {
    return configId;
  }

  public void setConfigId(Long configId) {
    this.configId = configId;
  }

  public String getConfigGroup() {
    return configGroup;
  }

  public void setConfigGroup(String configGroup) {
    this.configGroup = configGroup;
  }

  public String getConfigName() {
    return configName;
  }

  public void setConfigName(String configName) {
    this.configName = configName;
  }

  public String getConfigValue() {
    return configValue;
  }

  public void setConfigValue(String configValue) {
    this.configValue = configValue;
  }

  @Override
  public String toString() {
    return "ConfigInfo{" +
        "configId=" + configId +
        ", configGroup='" + configGroup + '\'' +
        ", configName='" + configName + '\'' +
        ", configValue='" + configValue + '\'' +
        '}';
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (!(o instanceof ConfigInfo)) {
      return false;
    }

    ConfigInfo that = (ConfigInfo) o;

    if (configId != null ? !configId.equals(that.configId) : that.configId != null) {
      return false;
    }
    if (configGroup != null ? !configGroup.equals(that.configGroup) : that.configGroup != null) {
      return false;
    }
    if (configName != null ? !configName.equals(that.configName) : that.configName != null) {
      return false;
    }
    return configValue != null ?
        configValue.equals(that.configValue) :
        that.configValue == null;

  }

  @Override
  public int hashCode() {
    int result = configId != null ? configId.hashCode() : 0;
    result = 31 * result + (configGroup != null ? configGroup.hashCode() : 0);
    result = 31 * result + (configName != null ? configName.hashCode() : 0);
    result = 31 * result + (configValue != null ? configValue.hashCode() : 0);
    return result;
  }
}
